<?php

namespace app\controllers;

use Yii;
use yii\web\Controller;
use yii\web\Request;
use yii\web\Response;
use proxy\HttpProxy;
use helper\SessionHelper;


class RespageController extends BaseController
{
    public function actionCall(){
        $response = Yii::$app->response;
        $request = Yii::$app->request;

        
        $check = $this->session->check($this->auth);
        if ($check['status'] == 0) {  //正常登陆
            $thisPath = $request->getPathInfo();
            $path_array = explode("/", $thisPath);//0:ajax, 1:call, 2,3:后端服务url 
            $new_path = '' ;
            for ($i=2; $i < count($path_array); $i++) { 
                if($i>2){
                    $new_path = $new_path.'/';
                }
                $new_path = $new_path.$path_array[$i];
                
            }
            return $this->myRenderFile('@app/resource/page/'.$new_path, []);
        } else if ($check['status'] == 1) {
            //没有登陆
            return $this->myRenderFile('@app/resource/page/venderapp/login.html', []);
            
        } else if ($check['status'] == 2) {
            //没有权限
            return $this->myRenderFile('@app/resource/page/venderapp/login.html', []);
            
        } else {
            return $this->myRenderFile('@app/resource/page/venderapp/login.html', []);
            
        }


            
            
        



        

       

    }


    
}
